var vue = new Vue({
    el: "#app",
    data: {
        nums: {},
        arr: [],
    },
    methods: {
        getData() {
            ajaxGet("/add/all", {}, (data) => {
                this.nums = data;
                let arr = [
                    {
                        name: "aa",
                        num: data.aa,
                    },
                    {
                        name: "bb",
                        num: data.bb,
                    },
                    {
                        name: "cc",
                        num: data.cc,
                    },
                    {
                        name: "dd",
                        num: data.dd,
                    },
                ];
                this.arr = arr.sort((a, b) => b.num - a.num);
            });
        },
        add(name) {
            ajaxGet("/add/num", { name: name }, () => {
                this.getData();
            });
        },
    },
    filters: {},
    created: function () {
        this.getData();
    },
});
